package com.alibaba.citrus.ots.sales.plan.service.impl.statistics;

import java.util.List;

import javax.annotation.Resource;

import com.alibaba.citrus.ots.sales.plan.service.statistics.SalesPlanStatQueryPortService;
import com.alibaba.citrus.ots.sales.plan.service.statistics.model.request.PageQueryAddressPortRequest;
import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.lattice2.epoch.sdk.model.Result;

import com.epoch.app.bcots.service.BaseDataService;
import com.epoch.app.otsplatformenhance.model.dto.PageQueryAddressListRequest;
import com.epoch.app.otsplatformenhance.model.dto.PageQueryAddressListResponse;
import com.epoch.app.otsplatformenhance.sdo.CustomerAddressSDO;
import com.epoch.app.otsplatformenhance.service.OtsPlatformEnhanceService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-23 15:23
 */
@Component
public class SalesPlanStatQueryPortServiceImpl implements SalesPlanStatQueryPortService {
    @Resource
    BaseDataService baseDataService;
    @Autowired
    OtsPlatformEnhanceService otsPlatformEnhanceService;

    @Override
    public Result<PageResult<List<CustomerAddressSDO>>> pageQueryCustomerAddress(PageQueryAddressPortRequest pageQueryAddressPortRequest) {
        PageQueryAddressListRequest pageQueryAddressListRequest = pageQueryCustomerAddressConverter(pageQueryAddressPortRequest);
        PageQueryAddressListResponse pageQueryAddressListResponse = otsPlatformEnhanceService.pageQueryAddressList(pageQueryAddressListRequest);
       /* List result = pageQueryAddressListResponse.getResult();*/
        return null;
    }

    private PageQueryAddressListRequest pageQueryCustomerAddressConverter(PageQueryAddressPortRequest pageQueryAddressPortRequest) {
        PageQueryAddressListRequest pageQueryAddressListRequest = new PageQueryAddressListRequest();
        BeanUtils.copyProperties(pageQueryAddressPortRequest, pageQueryAddressListRequest);
        return pageQueryAddressListRequest;
    }
}
